from ubuntu:18.04

# 镜像的作者  
 MAINTAINER cys
 
# 更换源
RUN  sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list

# 安装 ping / ifconfig 等工具
RUN apt-get update \
    && apt-get install -y vim \
    && apt-get install -y zip \
    && apt-get install -y net-tools \
    && apt-get install -y iputils-ping \
    && apt-get install -y openssh-server \
    && apt-get install -y openssh-client

# 修改root用户密码
RUN echo "root:root" | chpasswd

# 允许root ssh 登录
RUN echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config
RUN echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config

# 启动sshd服务并且暴露22端口  
RUN mkdir /var/run/sshd
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]
